home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vbxs / vbnetcom.000 / netcom.h < prev    next >
Text File  |  1996-04-08  |  7KB  |  173 lines

  1. /***************************************************************
  2.  
  3.    Copyright 1993  Northeast Data Corp.  All Rights Reserved
  4.  
  5. ****************************************************************/
  6.  
  7. /***************************************************************
  8.  
  9.  
  10.    NetCom.h
  11.  
  12.    Public definitions for applications that use the NetCom 
  13.    control.
  14.  
  15.     - Messages
  16.     - Notification codes.
  17.     - Control Styles.
  18.  
  19. ****************************************************************/
  20.    
  21.    // Useful constants
  22. #define MAXNETNAME      16       // Max netbios name length
  23.  
  24.    // Messages the application can send to the control
  25. #define NCM_SETCOMMAND           (WM_USER+1)
  26. #define NCM_SETNAME              (WM_USER+2)
  27. #define NCM_SETDATA              (WM_USER+3)
  28. #define NCM_SETREMOTENAME        (WM_USER+5)
  29. #define NCM_SETTRACE             (WM_USER+6)
  30. #define NCM_SETSESSION           (WM_USER+7)
  31. #define NCM_SETADAPTER           (WM_USER+8)
  32. #define NCM_SETSENDTIMEOUT       (WM_USER+9)
  33. #define NCM_SETRECTIMEOUT        (WM_USER+10)
  34. #define NCM_GETPROPERTY          (WM_USER+11)
  35.  
  36.    // Commands specified in wParam of the NCM_SETCOMMAND message
  37.    // Commands
  38. #define NCC_INIT              1
  39. #define NCC_REGISTERNAME      2
  40. #define NCC_REGISTERGROUP     3
  41. #define NCC_SENDDATAGRAM      4
  42. #define NCC_RECEIVEDATAGRAM   5
  43. #define NCC_CALL              6
  44. #define NCC_LISTEN            7
  45. #define NCC_SEND              8
  46. #define NCC_RECEIVE           9
  47. #define NCC_HANGUPONREC       10
  48. #define NCC_HANGUPONSEND      11
  49. #define NCC_CANCELALL         12
  50. #define NCC_RESET             13
  51. #define NCC_DELETENAME        14
  52. #define NCC_RECEIVEANY        15
  53. #define NCC_ADAPTERSTATUS     16
  54. #define NCC_LISTNAMES         17
  55. #define NCC_RECSESSSTATUS     18
  56. #define NCC_SENDSESSSTATUS    19
  57. #define NCC_RECEIVEBROADCAST  20
  58. #define NCC_SENDBROADCAST     21
  59. #define NCC_RECEIVEANYFORANY  22
  60.  
  61.    // wParam arguments for the NCM_SETSESSION message
  62. #define RECEIVESESSION        0
  63. #define SENDSESSION           1
  64.  
  65.    // Properties used in wParam of the NCM_GETPROPERTY message
  66. #define NC_PROP_NETNAME       0
  67. #define NC_PROP_NETDATA       1
  68. #define NC_PROP_NETTRACE      2
  69. #define NC_PROP_SENDSESSION   3
  70. #define NC_PROP_ADAPTER       4
  71. #define NC_PROP_REMOTENAME    5
  72. #define NC_PROP_NAMENUMBER    6
  73. #define NC_PROP_RECSESSION    7
  74. #define NC_PROP_SESSIONSTATUS 8
  75. #define NC_PROP_PERMNAME      9
  76. #define NC_PROP_SENDTIMEOUT   10
  77. #define NC_PROP_RECTIMEOUT    11
  78. #define NC_PROP_NETERROR      12
  79.  
  80.    // Notifications sent to the application
  81. #define NCN_RECEIVEDDATAGRAM        1
  82. #define NCN_RECEIVEDDATA            2
  83. #define NCN_SENDCOMPLETE            3
  84. #define NCN_NEWSENDSESSION          4
  85. #define NCN_NETNAME                 5
  86. #define NCN_NEWRECSESSION           6
  87. #define NCN_SESSIONCLOSED           7
  88. #define NCN_SESSIONERROR            8
  89.  
  90.    // The one callable function to force the DLL to load
  91. void FAR PASCAL registerNetCom(void);
  92.  
  93.    // High level Error codes
  94. #define VBERRB                   32000
  95. #define VBERR_ADDGROUP           (VBERRB)     // - Failed to add a group name
  96. #define VBERR_ADDNAME            (VBERRB+1)   // - Failed to add a unique name
  97. #define VBERR_UNK                (VBERRB+2)   // - Unknown error
  98. #define VBERR_INITFAIL           (VBERRB+3)   // - Failed to initialize the NetBIOS
  99. #define VBERR_DUPNAME            (VBERRB+4)   // - Duplicate name
  100. #define VBERR_BADRESET           (VBERRB+5)   // - Adapter reset failed
  101. #define VBERR_MEMALLOC           (VBERRB+6)   // - Memory allocation failure
  102. #define VBERR_SESSSTATUS         (VBERRB+7)   // - Session status command failed
  103. #define VBERR_TIMEOUT            (VBERRB+8)   // - Command timed out
  104. #define VBERR_NONIBS             (VBERRB+9)   // - No network information blocks available
  105. #define VBERR_NONETBIOS          (VBERRB+10)  // - Netbios is not installed
  106. #define VBERR_NONAME             (VBERRB+11)  // - Specified name not found
  107. #define VBERR_NOSESSION          (VBERRB+12)  // - Specified session number is invalid
  108.  
  109.    // Low level NetBIOS error codes 
  110.    //
  111.    // For the VBX control, these are the values in the NetError property.
  112.    //
  113.    // For the Custom Control, these are obtained by sending the
  114.    //  NCM_GETPROPERTY message with wParam set to NC_PROP_NETERROR.
  115.  
  116.  
  117. #define NRC_OK                            0x00     // Success
  118. #define NRC_ILGBUFLEN                0x01     // Invalid buffer length
  119. #define NRC_ILGCMD                    0x03     // Invalid command
  120. #define NRC_TIMEOUT                    0x05     // Timeout
  121. #define NRC_BUFSIZE                    0x06     // Invalid buffer size (same as 01)
  122. #define NRC_ILGSESSNUM                0x08     // Invalid session number
  123. #define NRC_SESSFULL                    0x09     // No more session numbers allowed
  124. #define NRC_SESSCLOSED                0x0A     // Session is closed
  125. #define NRC_CMDCANCELLED            0x0B     // Command was cancelled
  126. #define NRC_LDUPNAME                    0x0D     // Duplicate name
  127. #define NRC_NTFULL                    0x0E     // Name table is full
  128. #define NRC_SESSACT                    0x0F     // Session is active
  129. #define NRC_STFULL                    0x11     // Session table is full
  130. #define NRC_NOLISTEN                    0x12     // Listen has not been established
  131. #define NRC_ILGNAMENUM                0x13     // Invalid name number
  132. #define NRC_NORESP                    0x14     // No response
  133. #define NRC_ILGNAME                    0x15     // Illegal NetBIOS name
  134. #define NRC_RDUPNAME                    0x16     // Duplicate NetBIOS name
  135. #define NRC_NAMEDEL                    0x17     // Name has been deleted
  136. #define NRC_ABNZ                        0x18     // Buffer not terminated
  137. #define NRC_NAMECONFL                0x19     // Name is invalid
  138. #define NRC_BUSY                        0x21     // NetBIOS is busy
  139. #define NRC_TOOMANYCMDS                0x22     // No more commands accepted
  140. #define NRC_ILGADPNUM                0x23     // Invalid adapter number
  141. #define NRC_CANCELLED                0x24     // Command has been cancelled
  142. #define NRC_NOCANCEL                    0x26     // Cannot cancel command
  143. #define NRC_OPINCL                    0xFF     // Operation not yet completed
  144.  
  145.  
  146.    // Data types
  147.  
  148.    // Data received information block
  149. typedef struct
  150. {
  151.    LPSTR     lpData;
  152.    WORD      nLen;
  153.    char      szFrom[MAXNETNAME+1];
  154. } RECINFOSTRUCT, FAR *LPRECINFOSTRUCT;
  155.  
  156.    // Session information block
  157. typedef struct
  158. {
  159.    WORD      nSessionNumber;
  160.    WORD      nSessionState;
  161.    char      szLocalName[MAXNETNAME+1];
  162.    char      szRemoteName[MAXNETNAME+1];
  163. } SESSIONINFOSTRUCT, FAR *LPSESSIONINFOSTRUCT; 
  164.  
  165.    // The net names callback function
  166. typedef BOOL (FAR PASCAL* NAMECALLBACK)(LPSTR,int);
  167.  
  168.    // Session information callback function
  169. typedef BOOL (FAR PASCAL* SESSIONCALLBACK)(LPSESSIONINFOSTRUCT);
  170.  
  171.  
  172.     
  173.